<!--模型信息列表 开始-->
<div id="info_list">
    <div class="modal-header">
        <span class="modal-title" id="modal_white_title"><i class="fas fa-info-circle mr-1"></i>{$module_rs.title}</span>
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
    </div>
    <div class="modal-body">
        <div class="w-100 mb-3">
            <form name="form_checksearch" id="form_checksearch">
                <input type="hidden" name="lang" id="lang" value="{:input('lang')}">
                <input type="hidden" name="tabledir" value="{:input('tabledir')}">
                <div class="input-group">
                    <input name="keyword" id="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                    <span class="input-group-append">
                        <button id="search_sort" type="button" class="btn btn-success"><i class="fas fa-search mr-1"></i>{:lang('v_search')}</button>
                    </span>
                </div>
            </form>
        </div>
        <table class="table table-striped table-bordered table-hover">
            <tr>
                <td width="120" class="overflow-hidden">{:lang('v_title')}</td>
                <td>{:lang('v_linkurl')}</td>
                <td width="80" class="text-center overflow-hidden">{:lang('v_do')}</td>
            </tr>
            {volist name="list" id="rs"}
                {if input('client') eq 'app'}
                    {if $rs.page_sign neq '0'}
                        <tr>
                            <td>{$rs.title|msubstr=0,6}</td>
                            <td>
                                /pages/{:input('tabledir')}/
                                {if input('tabledir') eq 'about'}
                                    {switch rs.page_sign}
                                        {case contact}contact{/case}
                                        {case about}us{/case}
                                        {default /}view
                                    {/switch}
                                {else /}
                                    view
                                {/if}
                            </td>
                            <td class="text-center">
                                {if input('tabledir') eq 'about'}
                                    {switch rs.page_sign}
                                        {case contact}
                                            <button class="btn btn-sm btn-default" onclick="javascript:check_close('/pages/{:input('tabledir')}/contact');">{:lang('v_select')}</button>
                                        {/case}
                                        {case about}
                                            <button class="btn btn-sm btn-default" onclick="javascript:check_close('/pages/{:input('tabledir')}/us');">{:lang('v_select')}</button>
                                        {/case}
                                        {default /}
                                            <button class="btn btn-sm btn-default" onclick="javascript:check_close('/pages/{:input('tabledir')}/view');">{:lang('v_select')}</button>
                                    {/switch}
                                {else /}
                                    <button class="btn btn-sm btn-default" onclick="javascript:check_close('/pages/{:input('tabledir')}/view');">{:lang('v_select')}</button>
                                {/if}
                            </td>
                        </tr>
                    {/if}
                {else /}
                    <tr>
                        <td>{$rs.title|msubstr=0,6}</td>
                        <td><a href="{$rs['urlroute']}" target="_blank">{$rs['urlroute']}</a></td>
                        <td class="text-center"><button class="btn btn-sm btn-default" onclick="javascript:check_close('{$rs['urlroute']}');">{:lang('v_select')}</button></td>
                    </tr>
                {/if}
            {/volist}
        </table>
        {if input('client') neq 'app'}
            <div class="row">
                <div class="col-md-12 mt-2">
                    <div class="float-left mr-4">{$list->render()|raw}</div>
                    <div class="float-left mt-2">{:lang('v_total')} {$lastPage} {:lang('v_page')} {$total} {:lang('v_records')}</div>
                </div>
            </div>
        {/if}
    </div>
</div>
<script type="text/javascript">
//翻页
$("#info_list").delegate(".pagination a","click",function(){
    $.get(this.href,function(html){
        $("#info_list").replaceWith(html);
    });
    return false;
});
//搜索
$('#search_sort').click(function(){
    var href = '{:url('/navigation/info',['tabledir'=>$tabledir])}&lang='+$('#lang').val()+'&keyword='+$('#keyword').val()+'&client={:input('client')}';
    $.get(href,function(html){
        $("#info_list").replaceWith(html);
    });
});
//关闭窗口
function check_close(linkurl){
    $('#linkurl').attr('href',linkurl);
    $('input[name="linkurl"]').val(linkurl);
    $("#modal").modal("hide");
}
</script>
<!--模型信息列表 结束-->